package constants

import (
	commonConstants "gitee.com/igolang/imoney/internal/common/constants"
	"github.com/pkg/errors"
	"time"
)

const (
	SuperAdmin    = "admin"
	SuperAdminId  = 1
	AllPermission = "*:*:*"

	RootDeptId = 100

	TokenExpired = 6 * time.Hour

	LoginUser     = "login_user"
	LoginTokenKey = "sys_token"
	OkStatus      = commonConstants.SystemOkStatus
)

type OperationLogType int

const (
	OperationLogAdd      = OperationLogType(1)
	OperationLogUpdate   = OperationLogType(2)
	OperationLogRemove   = OperationLogType(3)
	OperationLogAuth     = OperationLogType(4)
	OperationLogExport   = OperationLogType(5)
	OperationLogImport   = OperationLogType(6)
	OperationLogOut      = OperationLogType(7)
	OperationLogGenCode  = OperationLogType(8)
	OperationLogClean    = OperationLogType(9)
	OperationLogUpload   = OperationLogType(10)
	OperationLogDownload = OperationLogType(11)

	PasswordPattern = `^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@!])[A-Za-z\d@!]{8,20}$` // 这个正则。go不支持
)

var (
	PasswordErr = errors.New("密码由数字，大小写字母，特殊字符@!组成，8-20位")
)
